function runbaGet() {
    toast("初始化");
    utils.openApp("com.quark.browser");
    sleep(random(500, 700));
    let b = runGetStart();
    if (!b) {
        antForestGoMTHome();
        if (findNode(descMatch("夸克"), true)) {
            sleep(random(300, 600));
            runGetStart();
        } else {
            toast("未找到浏览器！");
            loge("未找到浏览器！");
        }
    }
}

function runGetStart() {
    if (findNode(id("com.quark.browser:id/home_toolbar_menu"), true)) {
        sleep(random(1300, 1600));
        toast("打开浏览器菜单");
        if (findNode(textMatch("书签"), true)) {
            toast("打开书签");
        }
        sleep(random(2300, 3600));
        if (findNode(depth(20).index(3).textMatch("go.runba.cyou"), true)) {
            toast("打开runba");
        }
        for (i = 0; i < 10; i++) {
            if (findImagePlus(["登录3.png","登录1.png"], 563,126,959,416)) {
                toast("点击登录，进入主页面");
                sleep(random(1000, 1600));
                login();
                break;
            } else {
                toast("没进入主页面");
                sleep(random(2000, 3600));
            }
        }
        return true;
    }
    return false;
}

function login() {
    let names = [
        "491238410@qq.com",
        "491238411@qq.com",
        "491238412@qq.com",
        "491238413@qq.com",
        "491238414@qq.com",
        "491238415@qq.com",
        "491238416@qq.com",
        "491238417@qq.com",
        "491238418@qq.com",
        "491238419@qq.com",
        "491238420@qq.com",
    ];

    for (let i = 0; i < names.length; i++) {
        toast("name"+names[i]);
        if (findImagePlus(["邮箱2.png","邮箱1.png"], 73,490,923,676)) {
            sleep(random(1000, 1600));
            var selector = clz("android.widget.FrameLayout");
            var node = selector.getOneNodeInfo(1000)
            if (selector) {
                sleep(random(1000, 1600));
                node.imeInputText(names[i]);
                sleep(random(1000, 1600));
            }
        }
        if (findImagePlus(["密码2.png","密码1.png"], 113,670,919,940)) {
            sleep(random(1000, 1600));
            var selector = clz("android.widget.FrameLayout");
            var node = selector.getOneNodeInfo(1000)
            if (selector) {
                sleep(random(1000, 1600));
                node.imeInputText("12345678");
                sleep(random(1000, 1600));
            }
        }
        if (findImagePlus(["确认登录2.png","确认登录1.png"], 170,1003,926,1239)) {
            sleep(random(1000, 3000));
            for (i0 = 0; i0 < 3; i0++) {
                sleep(random(1000, 2000));
                clossArth();
                sleep(random(500, 1000));
            }
        }
        if (findImagePlus(["用户中心1.png"], 13, 226, 709, 696)) {
            for (i1 = 0; i1 < 5; i1++) {
                sleep(random(500, 1000));
                rndSwipe(185,1700,170,139, 30, 100, 300);
                sleep(random(500, 1000));
                if (findImagePlus(["已签到1.png","获取流量1.png"], 343,1220,796,1616)) {
                    for (i2 = 0; i2 < 3; i2++) {
                        sleep(random(2000, 3000));
                        clossArth();
                        sleep(random(500, 1000));
                    }
                }else {
                    sleep(random(1000, 1900));
                }
            }
            findImagePlus(["右上角图片飞机2.png","右上角图标飞机1.png"],763,60,1069,243)
            sleep(random(1000, 1500));
            findImagePlus(["登出1.png"],626,316,1056,522)
            for (i2 = 0; i2 < 3; i2++) {
                sleep(random(500, 1000));
                clossArth();
                sleep(random(500, 1000));
            }
            toLogin()
        }

    }

}

function toLogin() {
    let falg =false;
    for (i3 = 0; i3 < 10; i3++) {
        if (findImagePlus(["登录3.png","登录1.png"], 563,126,959,416)) {
            toast("点击登录，进入主页面");
            sleep(random(1000, 1600));
            falg =true;
            return true
        } else {
            toast("没进入主页面");
            sleep(random(2000, 3600));
        }
    }
    return falg;
}

